MarkTemple Donate

Check Office Version and Bitness
If you need to determine the version and the "bitness" (32/64 bit) of Office that you're running like this:

 
Copy and paste the following code into a batch (.bat) file (ie: Check Office Version and Bitness.bat):
@echo OFF


:: Check Office Version and Bitness
:: Written by MarkTemple.com
:: Dec 27, 2013


setlocal enableDelayedExpansion


for /f "tokens=2 delims==" %%O in ('ftype ^|findstr /r /I "\\OFFICE[0-9]*" 2^>nul') do (
set "tokens=%%~O"
goto END_TOKENS
)
:END_TOKENS


for %%P in (%tokens%) do (
set "officePath=%%~dpP"
for %%V in ("!officePath:~0,-1!") do (
set "officeVersion=%%~nV"
goto END_OFFICEPATH
)
)
:END_OFFICEPATH


REM Check Office "Version"
if "%officeVersion%" == "Office11" (
echo Microsoft Office 2003
)
if "%officeVersion%" == "Office12" (
echo Microsoft Office 2007
)
if "%officeVersion%" == "Office14" (
echo Microsoft Office 2010
)
if "%officeVersion%" == "Office15" (
echo Microsoft Office 2013
)


if "%officeVersion%" == "" (
echo Microsoft Office is not installed
goto END
)


REM Check Office "Bitness"
set keyName="HKLM\Software\WOW6432Node\Microsoft\Office"
set valueName=""


FOR /F "usebackq skip=4 tokens=1-3" %%A IN (`REG QUERY %keyName%`) DO (
set valueName=%%A
)


if defined valueName (
@echo Microsoft Office is 32-bit
) else (
set keyName="HKLM\Software\Microsoft\Office"
set valueName=""
FOR /F "usebackq skip=4 tokens=1-3" %%A IN (`REG QUERY %keyName%`) DO (
set valueName=%%A
)


if defined valueName (
@echo Microsoft Office is 64-bit
)
)


:END


endlocal


pause

 
Run the new .bat file!
 
Note: In Windows 7 you must run the command window as Administrator
 
* If this posting was helpful, you can donate by clicking here

© MarkTemple